Skip to content

fix(sdv-ship): ci_wait.py --sha no longer raises KeyError 'Copilot' (0.26.1) - #75

Merged
saiemgilani merged 3 commits into
mainfrom
fix/ci-wait-sha-mode
Nov 26, 2026
Merged

saiemgilani merged 3 commits into
mainfrom
fix/ci-wait-sha-mode

Conversation

@saiemgilani

@saiemgilani saiemgilani commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Why

ci_wait.py --sha never worked: every run ended on its first poll with
ERROR: unexpected KeyError: 'Copilot' / VERDICT: error (exit 6).

--sha reads no PR, so bots = {}. The Copilot quota-refusal check read
bots["Copilot"] before its copilot_asked_at is not None guard could short-circuit.

Change

  • ci_wait.py: that one lookup uses bots.get("Copilot", ("",))[0], like the CodeRabbit/Sourcery lookups.
    The other bots[...] reads are unreachable under --sha (they need a Copilot request or both bots rate-limited).
  • test_ci_wait.py: first --sha test, ready and failed verdicts. It fails on main with the KeyError.
  • plugin.json: 0.26.1.

Verified

  • release.py check: catalog, render, tools tests (74), hooks tests all ok.
  • Live, read-only: ci_wait.py sportsdataverse/.github --sha 14c633467 gives VERDICT: ready (exit 0) on this branch and KeyError on main.

Summary by CodeRabbit

  • Bug Fixes
    • SHA-only CI runs now report ready or failed verdicts without error when Copilot status is unavailable.
  • Chores
    • Updated the plugin version to 0.26.1.

…0.26.1)

--sha mode reads no PR, so bot_states() is skipped and bots is {}. The
Copilot quota-refusal check indexed bots["Copilot"] before its
copilot_asked_at guard, so every --sha run ended on its first poll with
"ERROR: unexpected KeyError: 'Copilot'" and VERDICT: error (exit 6).
Read it with .get, as the CodeRabbit/Sourcery lookups already do.

Adds the first --sha test (ready and failed verdicts); it fails on main.
@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Sorry @saiemgilani, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 14 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f3d5acb-a51e-4636-81e8-7d1b21eb5926
Commits

Reviewing files that changed from the base of the PR and between 3640cc4 and b7fbc75.

Files selected for processing: 1

  • sdv-toolkit/tools/test_ci_wait.py

No actionable comments were generated in the recent review.

Walkthrough

The quota-refusal check now handles a missing Copilot state in SHA-only runs. A regression test covers green and failing checks. The plugin manifest version changes to 0.26.1.

Changes: SHA-mode Copilot fallback

Layer / File(s) Summary
Copilot fallback and regression coverage
sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py, sdv-toolkit/tools/test_ci_wait.py, sdv-toolkit/.claude-plugin/plugin.json
The quota-refusal check defaults to an empty state when Copilot is absent. The SHA-only test checks the exit code, verdict, and bots: n/a for green and failing checks. The plugin manifest version changes to 0.26.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · previous review 3640c

This fixes a crash in the CI wait script when it runs with a commit SHA and no pull request. The change is small, and the new test covers the failing case. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the affected script and flag (ci_wait.py --sha), the symptom fixed (KeyError 'Copilot'), and the version bump (0.26.1). The changeset matches: ci_wait.py now uses a safe lookup for the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the affected script and flag (ci_wait.py --sha), the symptom fixed (KeyError 'Copilot'), and the version bump (0.26.1). The changeset matches: ci_wait.py now uses a safe lookup for the Copilot bot state, a new --sha test was added, and plugin.json moves to 0.26.1. The title is specific and accurate. It is slightly dense because it includes the version number, but it still names the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3104f156-4e8b-4f40-ba03-a4f0bc870fe2
Commits

Reviewing files that changed from the base of the PR and between 14c6334 and 3640cc4.

Files selected for processing: 3

  • sdv-toolkit/.claude-plugin/plugin.json
  • sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py
  • sdv-toolkit/tools/test_ci_wait.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@saiemgilani
saiemgilani merged commit f1f95c2 into main Nov 26, 2026
6 checks passed
@saiemgilani
saiemgilani deleted the fix/ci-wait-sha-mode branch November 26, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant